<?php include 'home_css_js.php'; ?>

    <div id="container">

<?php include 'home_header.php';?>

        <div id="main">
            <div id="home-banner">
                <div id="banner">
                    <ul class='bn-slide'>
                        <?php $i=1; foreach ($arySlider as $key => $value) {?>
                            <li class='<?php echo ($i==1) ? 'active' : '';?>' >
                                <a href="<?php echo $value['slider_link'];?>" target="_blank" title='<?php echo $value['slider_title'];?>' rel="<?php echo $value['slider_image'];?>">
                                    <img src='<?php echo $value['slider_image'];?>'  width=738 height=300 />
                                </a>
                            </li>
                        <?php $i++;} ?>
                    </ul>
                    <ul class='bn-pg'>
                        <?php $i=0; foreach ($arySlider as $key => $value) {?>
                            <li class='<?php echo ($i==0) ? 'active' : ''?>'>
                                <a href='#' title='Trang <?php echo $i;?>' rel='<?php echo $i;?>'><?php echo $i+1;?></a>
                            </li>
                        <?php $i++; }?>
                    </ul>
                </div>
            </div>
            <div id="home-video">
                <div id="home-video-title">
                    <div class="title_support">
                        HỖ TRỢ TRỰC TUYẾN
                    </div>
                </div>

                <div id="hm-video-body">
                    <table cellpadding="0" cellspacing="0" width="100%">
                        <?php foreach ($arySupport as $key => $value) {
 ?>
                            <td>
                                <div class="suppor_online">
                                    <div style="overflow: hidden;">
                                        <div class="list_support_name">
                                            <span style="color:#3A89B4;"><?php echo $value['name']; ?></span>
                                        </div>
                                        <div class="list_support_ya">
                                            <a href="ymsgr:sendIM?<?php echo $value['yahoo']; ?>"><img border="0" align="absmiddle" src="http://opi.yahoo.com/online?u=<?php echo $value['yahoo']; ?>&amp;m=g&amp;t=1"></a>
                                            <a href="skype:<?php echo $value['skype']; ?>?chat"><img src="http://mystatus.skype.com/smallicon/<?php echo $value['skype']; ?>"></a>
                                        </div>
                                    </div>
                                    <div class="support_phone">
                                        <?php echo $value['mobile']; ?>
                                    </div>
                                </div>

                            </td>
                        </tr>
<?php } ?>
                    </table>

                </div>

            </div>
            <div class="clear">
            </div>
            <div class="clear" style="height: 9px;">
            </div>
            <div id="main-left">
                <div class="clear" style="height: 8px;">
                </div>

                <?php foreach ($aryConfCategory as $key => $value) {
 ?>

                    <div id="hm-pr">
                        <div id="hm-pr-we">

                            <ul class="hm-pr-we-title pr-lt-ca">
                                <li class='first'></li>
                                <li>
                                    <a class="" href="<?php echo $root_page ?>/danhmuc/<?php echo $value['category_id']; ?>/<?php echo $value['category_filter']; ?>.html" title="<?php echo $value['category_name']; ?>" ><span><?php echo $value['category_name']; ?></span></a>
                                </li>
                            </ul>

                            <div class="clear" style="height: 13px;">
                            </div>
                            <div class="hm-pr-dl-content pr-lt-ca-content">
                                <ul class='pr-lt-ca-ct-pl'>
                                <?php if (is_array($aryProduct[$value['category_id']])) {?>
                                <?php $i = 1;
                                    foreach ($aryProduct[$value['category_id']] as $key => $product) { ?>

                                        <?php
                                        $productHiglight = str_replace("\n", '<br>', $product['product_highlight']);
                                        $productHiglight = str_replace("\r", '<br>', $productHiglight);
                                        $productHiglight = str_replace("\"", '', $productHiglight);

                                        $product_promotional = str_replace("\n", '<br>', $product['product_promotional']);
                                        $product_promotional = str_replace("\r", '<br>', $product_promotional);
                                        $product_promotional = str_replace("\"", '', $product_promotional);
                                        ?>

                                        <li class='pr-lt-it <?php echo ($i%4==0) ? 'last' : '';?>'>
                                            <ul>
                                                <li class='img'>
                                                    <a href='<?php echo $root_page?>/sanpham/<?php echo $product['product_id']; ?>/<?php echo $product['product_title_filter']; ?>.html' >
                                                        <img src="<?php echo $root_page?>/<?php echo $product['product_main_image']; ?>" alt="<?php echo $product['product_title']; ?>" title="<?php echo $product['product_title']; ?>">
                                                    </a>
                                                    <span class='icon'></span>
                                                </li>
                                                <li class='name'>
                                                    <a href='<?php echo $root_page?>/sanpham/<?php echo $product['product_id']; ?>/<?php echo $product['product_title_filter']; ?>.html' ><?php echo $product['product_title']; ?></a>
                                                </li>
                                                <?php if($product['product_price_vnd_km'] != 0 && $product['product_price_active_km'] == 1){?>
                                                    <li class='price-market'><span><?php echo number_format($product['product_price_vnd_km'], 0, ',', '.').'&nbsp;VNĐ';?></span></li>
                                                <?php } ?>

                                                <li class='price-save'><span></span></li>
                                                <li class='price'><span><?php echo ($product['product_price_vnd'] != 0) ? number_format($product['product_price_vnd'], 0, ',', '.') . '&nbsp;VNĐ' : 'Call'; ?></span></li>
                                            </ul>
                                            <div class='pl-horizontal-col-hover'>
                                                <ul>
                                                    <li class='pl-horizontal-col-hover-top'>
                                                        <span class="pl-hz-name"><?php echo $product['product_title']; ?></span>
                                                        <span class="pl-hz-price">GIÁ BÁN : <?php echo number_format($product['product_price_vnd'], 0, ',', '.').'&nbsp;VNĐ'?></span>
                                                    </li>
                                                    <li class="pl-horizontal-col-hover-center">
                                                        <span class="pl-hz-title">KHUYẾN MẠI</span>
                                                        <span class="pl-hz-promotion">
                                                            <?php
                                                                $product_promotional = str_replace("\n", '<br>', $product['product_promotional']);
                                                                $product_promotional = str_replace("\r", '<br>', $product_promotional);
                                                                $product_promotional = str_replace("\"", '', $product_promotional);
                                                            ?>
                                                            <?php echo $product_promotional;?>
                                                        </span>
                                                    </li>
                                                    <li class="pl-horizontal-col-hover-bottom">
                                                        <span class="pl-hz-title">TÍNH NĂNG NỔI BẬT</span>
                                                        <span class="pl-hz-summary">
                                                            <?php
                                                                $productHiglight = str_replace("\n", '<br>', $product['product_highlight']);
                                                                $productHiglight = str_replace("\r", '<br>', $productHiglight);
                                                                $productHiglight = str_replace("\"", '', $productHiglight);
                                                            ?>
                                                            <?php echo $productHiglight;?>
                                                        </span>
                                                    </li>
                                                </ul>
                                            </div>
                                        </li>

                                    <?php $i++; } ?>
                                    <?php } ?>

                            </ul>
                            <div class='clear'></div>

                        </div>
                    </div>
                    <div class="clear" style="height: 13px;">
                    </div>
                </div>
                <div class="clear" style="height: 16px;">
                </div>
<?php } ?>
        <div id="hm-nl-ft">
    <ul class="hm-nl-ft-menu">
        <li class="first"></li>
        <li><span><a rel="" title="Tin tức" href="<?php echo $root_page;?>/tintuc/" class="active">Tin tức</a></span></li>
        <?php foreach ($aryRootNewsCategory as $key => $value) {?>
        <li><span><a title="<?php echo $value['news_category_name'];?>"  href="<?php echo $root_page;?>/tin/<?php echo $value['news_category_id'];?>/<?php echo $value['news_category_filter'];?>.html"><?php echo $value['news_category_name'];?></a></span> </li>
        <?php } ?>
        <li class="last"></li>
    </ul>
    <div style="height: 25px;" class="clear"></div>
    <div id="hm-nl-ft-content">
        <ul class="hm-nl-ft-ct-col1 hm-nl-ft-ct-item">
        <?php foreach ($aryNews as $key => $value) {?>
            <?php if($key < 7){?>
                <?php if($key == 0){?>
                    <li class="nl-it-first">
                <div class="nl-img">
                    <a title="<?php echo $value['news_title'];?>" href="<?php echo $root_page;?>/chitiet/<?php echo $value['news_id'];?>/<?php echo $value['news_title_filter'];?>.html">
                        <img alt="<?php echo $value['news_title'];?>" src="<?php echo $value['news_main_image'];?>">
                    </a>
                </div>
                <div class="nl-title">
                    <a title="<?php echo $value['news_title'];?>" href="<?php echo $root_page;?>/chitiet/<?php echo $value['news_id'];?>/<?php echo $value['news_title_filter'];?>.html">
                        <span class="nl-title-link"><?php echo $value['news_title'];?></span>
                    </a>
                    <span>

                            <span style="font-size: small;"><?php echo $value['news_content_filter'];?></span>

                    </span>
                </div>
            </li>
                <?php }else{?>
                <li>
                    <span class="nl-icon"></span>
                    <span class="nl-content">
                        <a title="<?php echo $value['news_title'];?>" href="<?php echo $root_page;?>/chitiet/<?php echo $value['news_id'];?>/<?php echo $value['news_title_filter'];?>.html"><?php echo $value['news_title'];?></a>
                    </span>
                </li>
                <?php } ?>
            <?php } ?>
        <?php } ?>

            <li class="nl-it-last">
                <a title="Xem tất cả" href="<?php echo $root_page;?>/tintuc/">Xem tất cả &gt;&gt;</a>
            </li>
        </ul>
        <ul class="hm-nl-ft-ct-col2 hm-nl-ft-ct-item">
            <?php foreach ($aryNews as $key => $value) {?>
            <?php if($key >= 7){?>
                <?php if($key == 7){?>
                    <li class="nl-it-first">
                <div class="nl-img">
                    <a title="<?php echo $value['news_title'];?>" href="<?php echo $root_page;?>/chitiet/<?php echo $value['news_id'];?>/<?php echo $value['news_title_filter'];?>.html">
                        <img alt="<?php echo $value['news_title'];?>" src="<?php echo $value['news_main_image'];?>">
                    </a>
                </div>
                <div class="nl-title">
                    <a title="<?php echo $value['news_title'];?>" href="<?php echo $root_page;?>/chitiet/<?php echo $value['news_id'];?>/<?php echo $value['news_title_filter'];?>.html">
                        <span class="nl-title-link"><?php echo $value['news_title'];?></span>
                    </a>
                    <span>

                            <span style="font-size: small;"><?php echo $value['news_content_filter'];?></span>

                    </span>
                </div>
            </li>
                <?php }else{?>
                <li>
                    <span class="nl-icon"></span>
                    <span class="nl-content">
                        <a title="<?php echo $value['news_title'];?>" href="<?php echo $root_page;?>/chitiet/<?php echo $value['news_id'];?>/<?php echo $value['news_title_filter'];?>.html"><?php echo $value['news_title'];?></a>
                    </span>
                </li>
                <?php } ?>
            <?php } ?>
        <?php } ?>
            <li class="nl-it-last">
                <a title="Xem tất cả" href="<?php echo $root_page;?>/tintuc/">Xem tất cả &gt;&gt;</a>
            </li>
        </ul>
        <div class="clear"></div>

    </div>
</div>
            </div>
            <div id="main-right">
                <?php include 'product_right_item_top_3.php';?>
                <tr>
                    <td width="220" valign="top">
            </td>
        </tr>
        <div class="clear" style="width: 220px; height: 8px; display: block">
        </div>
    </div>
    <div class="clear">
    </div>

</div>
<div class="clear">
</div>

<?php include 'home_footer.php';?>

</div>

